<?php
namespace app\common\validate;
use think\Validate;
use \think\Loader;

// +----------------------------------------------------------------------
// | XpCms
// +----------------------------------------------------------------------
// | Copyright (c) 2021-2099
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Mercurio（Xp） <725668993@qq.com>
// +----------------------------------------------------------------------

/*
** 文章分类表 模型验证器
*/

class Channeltype extends Validate {
	
	// 验证规则
	protected $rule = [
			'typename' 		=> 'require',
			'nid' 		=> 'require',
			'maintable' 		=> 'require',
			'status' 	=> 'in:0,1',
		];
	
	// 返回对应信息
	protected $message = [
			'typename.require' 			=> '模型名称不能为空',
			'nid.require' 		=> '别名不能为空',
			'maintable.require' 		=> '表名称不能为空',
			'status.in' 			=> '状态值范围不正确',
		];
	
	// 验证场景
	protected $scene = [
			'add' 	=> ['typename', 'nid', 'maintable', 'status'],
			'edit' 	=> ['typename', 'nid', 'maintable', 'status']
		];
	

}
